package com.aspose.cells;

abstract class zhd extends zm {
   private boolean e;
   protected zrh a;
   protected zrh b;
   protected double c;
   protected double d;

   public zhd(boolean var1) {
      this.e = var1;
   }

   protected abstract void a();

   protected abstract void b();

   public abstract double c();

   protected abstract boolean d();

   protected void e() {
      this.c = this.a(this.a);
   }

   protected void f() {
      this.d = this.a(this.b);
   }

   public int a(String var1, char var2) {
      if (this.d()) {
         if (this.a == null) {
            this.b();
         }

         return this.e ? (int)((this.c() - (double)(var1 != null && !var1.equals("") ? this.a.a(var1) : 0)) / (double)this.a.a(var2)) : (int)((this.c() * this.c - (double)(var1 != null && !var1.equals("") ? this.a.a(var1) : 0)) / (double)this.a.a(var2));
      } else {
         if (this.b == null) {
            this.a();
         }

         if (this.e) {
            return (int)((this.c() - (var1 == null ? 0.0D : (double)this.b.a(var1))) / (double)this.b.a(var2));
         } else {
            if (this.a == null) {
               this.b();
            }

            return (int)((this.c() * this.c - (var1 == null ? 0.0D : (double)this.b.a(var1))) / (double)this.b.a(var2));
         }
      }
   }

   public int a(String var1, String var2) {
      if (this.d()) {
         if (this.a == null) {
            this.b();
         }

         return this.e ? (int)((this.c() - (double)(var1 != null && !var1.equals("") ? this.a.a(var1) : 0)) / (double)this.a.a(var2)) : (int)((this.c() * this.c - (double)(var1 != null && !var1.equals("") ? this.a.a(var1) : 0)) / (double)this.a.a(var2));
      } else {
         if (this.b == null) {
            this.a();
         }

         if (this.e) {
            return (int)((this.c() - (var1 == null ? 0.0D : (double)this.b.a(var1))) / (double)this.b.a(var2));
         } else {
            if (this.a == null) {
               this.b();
            }

            return (int)((this.c() * this.c - (var1 == null ? 0.0D : (double)this.b.a(var1))) / (double)this.b.a(var2));
         }
      }
   }

   protected int a(String var1) {
      if (this.d()) {
         if (var1 != null && !var1.equals("")) {
            if (this.a == null) {
               this.b();
            }

            return this.e ? (int)((this.c() - (double)this.a.a(var1)) / this.c) : (int)(this.c() - (double)this.a.a(var1) / this.c);
         } else {
            return (int)this.c();
         }
      } else {
         if (this.b == null) {
            this.a();
         }

         if (this.e) {
            return (int)((this.c() - (var1 == null ? 0.0D : (double)this.b.a(var1))) / this.d);
         } else {
            if (this.a == null) {
               this.b();
            }

            return (int)((this.c() * this.c - (var1 == null ? 0.0D : (double)this.b.a(var1))) / this.d);
         }
      }
   }
}
